Method for estimating a quantum phase

ABSTRACT

A method of determining a quantum phase of quantum device including performing a plurality of measurements for cosine and sine components of the quantum phase; counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and determining the quantum phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.

BACKGROUND

The currently claimed embodiments of the present invention relate to quantum computation, and more specifically, to a method for estimating a quantum phase in a quantum device.

In quantum computations, it is desirable to estimate the quantum phase in order to determine the eigenvalues of a unitary operator operating on a quantum state and thus determine the energy level(s) of the quantum state. The importance of quantum phase estimation is highlighted by the wide range of applications that rely on it, including, for example, Shor's prime factorization algorithm to find the prime factors of a given number, in quantum chemistry to determine molecular energy levels of multi-atomic molecular systems or find the molecular electronic structure of complex molecules (e.g., bio-molecules), and in quantum Metropolis sampling for the simulation of many-body quantum physics in interacting quantum particles (e.g., condensed matter physics, chemistry, and high energy physics).

The two main approaches to quantum phase estimation are the Fourier-based approach and Kitaev's algorithm. For example, Kitaev's algorithm is based on the estimation of the quantum phase by calculating the sine and cosine values of the quantum phase and then using the sine and cosine values to determine the phase using arctangent. However, Kitaev's approach is a lengthy process and requires repeated measurements using a quantum circuit and repeated calculations of the cosine and sine values of the quantum phase to then extract the quantum phase using arctangent. Each measurement involves “adding” another quantum circuit (the quantum circuit having a plurality of gates) to a quantum device. This results in the quantum device having a relatively larger depth due to the requirement of performing many measurements. The term depth in quantum computing is defined as the number of gates or circuit elements on any path from input to output.

SUMMARY

An aspect of the present invention is to provide a method for determining a quantum phase induced by a unitary operator in a quantum device. The method includes providing a plurality of quantum circuits connected in series, wherein an output of a first quantum circuit in the plurality of quantum circuits is an input of a second quantum circuit in the plurality of quantum circuits. The method further includes determining a quantum phase induced by the unitary operator by performing a plurality of measurements of an output of each of the plurality of quantum circuits comprising performing a first measurement in the plurality of measurements of the quantum phase using the first quantum circuit in the plurality of quantum circuits and performing a second measurement in the plurality of measurements of the quantum phase using the second quantum circuit in the plurality of quantum circuits. A number of the plurality of quantum circuits used to determine the quantum phase depends on a number of the plurality of measurements needed to determine the quantum phase within a desired precision, wherein the number of the plurality of measurements is reduced for the desired precision by using a majority sampling method. The majority sampling method includes performing a plurality of measurements for cosine and sine components of the quantum phase; counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and determining the quantum phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.

In an embodiment, determining the phase based on the majority of the number of 0 measurements and the number of 1 measurements of the sine component and the cosine component comprises determining a quantization of the quantum phase q(n_(x), n_(y)) as a function of the number of measurements (n_(y)) in the vertical axis for the sine component and the number of measurements (n_(x)) in the horizontal axis for the cosine component.

In an embodiment, the quantization of the quantum phase q(n_(x), n_(y)) is equal to:

0.00 if n_(x) is greater than or equal to a maximum of n_(y) and n−n_(y)+1;

0.01 if n_(y) is greater than or equal to a maximum of n_(x)+1 and n−n_(x);

0.10 if n−n_(x) is greater than or equal to a maximum of n_(y)+1 and n−n_(y); and

0.11 otherwise.

In an embodiment, the performing the first measurement or the second measurement includes applying a first Hadamard gate to a first state of a first qubit to put the first qubit into a superposition of states; applying a phase shift gate to the superposition of states of the first qubit to apply a first phase to the first qubit; applying a unitary operator (U^(s)) gate to a quantum state conditioned on the first qubit to apply a second phase to the quantum state; applying a second Hadamard gate to the first qubit; performing a measurement on the first qubit to determine probability values of measuring an output value of one based on input values of the first phase, the probability value depending on the first phase and the second phase; and determining the second phase based on the probability values.

In an embodiment, determining the second phase comprises selecting a value of the first phase equal to zero radian and −¼ radian and estimating a sine and a cosine of the second phase based on probability values of obtaining an initial second phase at the selected value of the first phase.

In an embodiment, applying the unitary operator (U^(s)) gate to the quantum state comprises applying the second phase multiplied by a factor that is proportional to 2 to the power j−1, wherein the second phase is expressed as a string of binary bits after the binary point and wherein j corresponds to incremental bit positions of binary bit values in the string of binary bits of the second phase.

In an embodiment, the method further includes iteratively adding one bit to the string of binary bits of an initial second phase per step and shifting a previous bit string by one, and repeating applying the first Hadamard gate to the first state of the first qubit; applying the phase shift gate to the superposition of states of the first qubit to apply the first phase to the first qubit; applying the unitary operator (U^(s)) gate to the quantum state conditioned on the first qubit to apply the second phase to the quantum state; applying the second Hadamard gate on the first qubit; performing the measurement on the first qubit to determine the probability values of measuring the output value of one based on the input values of the first phase, the probability value depending on the first phase and the second phase; and determining an updated value of the second phase.

In an embodiment, the method further includes choosing the first phase equal to the updated second phase divided by minus two to obtain an adjusted second phase that is a threshold value away from a horizontal axis; determining a sign of a cosine of the adjusted second phase; and setting a value of a last added binary bit in the string of binary bits of the updated second phase based on the determined sign of the cosine of the adjusted second phase. In an embodiment, if the sign of the cosine of the adjusted second phase is positive, setting the last added binary bit of the string of binary bits of the updated second phase to 0 and if the sign of the cosine of the adjusted second phase is negative, setting the last added binary bit of the string of binary bits of the updated second phase to 1.

In an embodiment, determining the updated value of the second phase comprises determining with a probability equal to at least substantially one a position of the updated second phase based on the sign of the cosine relative to right or left of a vertical axis when the adjusted second phase is at most π/4 from either 0 or π, or relative to a horizontal axis when the adjusted second phase is at most π/4 from either π/2 or 3π/2, or both.

Another aspect of the present invention is to provide a method of determining a quantum phase of a quantum device. The method includes performing a plurality of measurements for cosine and sine components of the quantum phase; counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and determining the quantum phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.

In an embodiment, determining the phase based on the majority of the number of 0 measurements and the number of 1 measurements of sine component and the cosine component comprises determining a quantization of the quantum phase q(n_(x), n_(y)) as a function of the number of measurements (n_(x)) in the vertical axis for the sine component and the number of measurements (n_(y)) in the horizontal axis for the cosine component.

In an embodiment, the quantization of the quantum phase q(n_(x), n_(y)) is equal to:

0.00 if n_(x) is greater than or equal to a maximum of n_(y) and n−n_(y)+1;

0.01 if n_(y) is greater than or equal to a maximum of n_(x)+1 and n−n_(x);

0.10 if n−n_(x) is greater than or equal to a maximum of n_(y)+1 and n−n_(y); and

0.11 otherwise.

In an embodiment, the method further includes iteratively adding one bit to the string of binary bits of an initial second phase per step and shifting a previous bit string by one, and repeating applying the first Hadamard gate to the first state of the first qubit; applying the phase shift gate to the superposition of states of the first qubit to apply the first phase to the first qubit; applying the unitary operator (U^(s)) gate to the quantum state conditioned on the first qubit to apply the second phase to the quantum state; applying the second Hadamard gate on the first qubit; performing the measurement on the first qubit to determine the probability values of measuring the output value of one based on the input values of the first phase, the probability value depending on the first phase and the second phase; and determining an updated value of the second phase.

In an embodiment, the method further includes choosing the first phase equal to the updated second phase divided by minus two to obtain an adjusted second phase that is a threshold value away from a horizontal axis; determining a sign of a cosine of the adjusted second phase; and setting a value of a last added binary bit in the string of binary bits of the updated second phase based on the determined sign of the cosine of the adjusted second phase. In an embodiment, if the sign of the cosine of the adjusted second phase is positive, setting the last added binary bit of the string of binary bits of the updated second phase to 0 and if the sign of the cosine of the adjusted second phase is negative, setting the last added binary bit of the string of binary bits of the updated second phase to 1.

In an embodiment, determining the updated value of the second phase comprises determining with a probability equal to at least substantially one a position of the updated second phase based on the sign of the cosine relative to right or left of a vertical axis when the adjusted second phase is at most π/4 from either 0 or π, or relative to a horizontal axis when the adjusted second phase is at most π/4 from either π/2 or 3π/2, or both.

Another aspect of the present invention is to provide a quantum device having a plurality of quantum circuits for determining the quantum phase. The quantum device including a plurality of quantum circuits connected in series, wherein an output of a first quantum circuit in the plurality of quantum circuits is an input of a second quantum circuit in the plurality of quantum circuits. The plurality of quantum circuits are configured and arranged to determine a quantum phase induced by a unitary operator in the quantum device by performing a plurality of measurements of an output of each of the plurality of quantum circuits comprising performing a first measurement in the plurality of measurements of the quantum phase using the first quantum circuit in the plurality of quantum circuits and performing a second measurement in the plurality of measurements of the quantum phase using the second quantum circuit in the plurality of quantum circuits. A number of the plurality of quantum circuits used to determine the quantum phase depends on a number of the plurality of measurements needed to determine the quantum phase within a desired precision. The number of the plurality of measurements is reduced for the desired precision by using a majority sampling method including performing a plurality of measurements for cosine and sine components of the quantum phase; counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and determining the phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.

In an embodiment, the first quantum circuit or the second quantum circuit or both includes a first Hadamard gate configured to apply to a first state of a first qubit to put the first qubit into a superposition of states; a phase shift gate configured to apply to the superposition of states of the first qubit a first phase; a unitary operator (U^(s)) gate configured to apply to a quantum state conditioned on the first qubit a second phase; a second Hadamard gate configured to apply a second quantum phase to the first qubit; and a measurement component configured to perform a measurement on the first qubit to determine probability values of measuring an output value of one based on input values of the first phase, the probability value depending on the first phase and the second phase.

One benefit of the present invention is to determine the quantum phase with a reduced or minimized number of measurements so as to reduce the number of quantum circuits (or circuit elements such as gates) and hence reduce or minimize the depth of the quantum device for determining the quantum phase.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure, as well as the methods of operation and functions of the related elements of structure and the combination of parts and economies of manufacture, will become more apparent upon consideration of the following description and the appended claims with reference to the accompanying drawings, all of which form a part of this specification, wherein like reference numerals designate corresponding parts in the various figures. It is to be expressly understood, however, that the drawings are for the purpose of illustration and description only and are not intended as a definition of the limits of the invention.

FIG. 1 is a schematic diagram of a quantum device using a plurality of quantum circuits, according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a first quantum circuit or a second quantum circuit in the quantum device, according to an embodiment of the present invention;

FIG. 3A is a plot showing that the estimation of the angle Φ_(j) indicated by the dot that is done by obtaining estimates of the sine and cosine values (indicated by the purple cross), according to an embodiment of the present invention;

FIG. 3B is a plot showing that the estimation of the angle 100 _(i) when the last two bits are fixed to the leading two from previous estimates gives points closest to 001, indicated by the shaded region, or closest to 101 and measuring the cross determines β′_(j)=0, according to an embodiment of the present disclosure;

FIGS. 4A and 4B are plots showing an application of a phase shift that ensures that the unknown angle (indicated by the dot) lies within one of the highlighted wedges centered on the horizontal axis, according to an embodiment of the present invention;

FIG. 5A is a plot showing an estimation of angle ϕ with accuracy η, according to an embodiment of the present invention;

FIG. 5B is a plot showing the same estimation as in FIG. 5A based on discrete points during sampling, according to an embodiment of the present invention;

FIGS. 6A and 6B are plots showing the error probability 1−Pr(K_(n,δ)(p)) as a function of angle for δ=0.3, when taking eight measurements, according to embodiments of the present invention;

FIGS. 7A and 7B are plots showing combinations of sine and cosine measurements that estimate the angle at the center of the wedge with maximum deviation ⅛, according to an embodiment of the present invention;

FIGS. 8A-8D are plots showing the estimation of (a) the horizontal, (b) the vertical component of the angle, accurate for angles in the shaded regions, (c) combination of the two sign-based estimates to obtain a ¼ accurate quantization, and (d) alternative quantization obtained by applying a π/4 rotation before the measurements and an inverse rotation and relabeling afterwards, according to an embodiment of the present invention;

FIGS. 9A-9C are plots of classification regions for majority-based sampling for (a) odd, and (b) even n; and (c) the success set K_(n) for angles in the range [0, π/2), according to an embodiment of the present invention;

FIG. 10 is a plot of error probability f_(n)(α) scaled by 2^(n), with from top to bottom n=1, 2, 3, 5, 10, 25, 100, 500, according to an embodiment of the present invention;

FIGS. 11A and 11B are plots of the numerical evaluation of N_(∈) along with the theoretical upper bound, using (a) triple-sign sampling, and (b) majority-based sampling, respectively, according to an embodiment of the present invention;

FIGS. 12A-12D show constructions for bounding (a,b) d_(n)−1 based on d_(n), and (c,d) the sum of d_(k) for strided k, according to an embodiment of the present invention; and

FIGS. 13A-13B are plots of key quantities used in verifying a statement with respect to error probability, according to an embodiment of the present invention.

DETAILED DESCRIPTION

FIG. 1 is a schematic diagram of a quantum device using a plurality of quantum circuits, according to an embodiment of the present invention. As shown in FIG. 1, the quantum device 10 includes a plurality of quantum circuits 12 that are connected in series. The plurality of quantum circuits include a first quantum circuit 12A and a second quantum circuits 12B. The first quantum circuit 12A has an input 14A and an output 14B. The second quantum circuit 12B has an input 16A and an output 16B. An output 14B of the first quantum circuit 12A in the plurality of quantum circuits 12 is connected to an input 16A of the second quantum circuit 12B in the plurality of quantum circuits 12. Although two quantum circuits are discussed herein and shown in FIG. 1, as it can be appreciated, many more quantum circuits can be used as illustrated by the dotted line which indicates that 2 or more quantum circuits can be used as will be explained further in the following paragraphs.

The quantum circuits 12A and 12B include a unitary operator gate that induces a quantum phase φ on an input quantum state |ξ> of the respective circuits 12A and 12B. It is desirable to estimate the quantum phase φ in order to evaluate the eigenvalue λ of the unitary operator U and thus determine the energy level of the input quantum state. The eigenvalue λ as a result of the unitarity can be written as λ=e^(i2πφ) with φ in the interval [0, 1).

The quantum phase 2πφ induced by the unitary operator can be estimated by performing a plurality of measurements of an output of each of the plurality of quantum circuits. Performing the plurality of measurement on the output of each of the plurality of quantum circuits includes performing a first measurement in the plurality of measurements of the quantum phase φ using the first quantum circuit 12A and performing a second measurement in the plurality of measurements of the quantum phase 2πφ using the second quantum circuit 12B. In the present disclosure, although the quantum phase is 2πφ, the quantum phase is noted herein throughout as φ for reasons of simplicity, however the factor 2π is implied.

A number of the plurality of quantum circuits 12 used to determine the quantum phase φ depends on a number of the plurality of measurements needed to determine the quantum phase φ within a desired precision. For example, if two measurements are performed to determine the quantum phase φ, two quantum circuits 12 (for example quantum circuits 12A and 12B) may be needed to accomplish this task. Similarly, by extension, if N measurements are performed to determine the quantum phase φ, N quantum circuits 12 may be needed to accomplish this task. In an embodiment, the desired precision can be preset by the user as desired. In an embodiment, the desired precision is set to be at least 2 binary bits after the binary point, for example (.mn, where mn are the binary numbers 0 or 1).

As stated in the above paragraphs, it is desirable to reduce or minimize the number of measurements so as to reduce the number of quantum circuits 12 (or circuit elements such as gates in the quantum circuits 12) and hence reduce or minimize the depth of the quantum device for estimating the quantum phase φ. The minimization of the number of measurements can be achieved by using a majority sampling method. The inventor developed the method of majority sampling to reduce or minimize the number of measurements and hence reduce or minimize the depth of the quantum device, resulting in an overall efficient process in determining or estimating the quantum phase φ.

In an embodiment, the novel majority sampling method includes i) performing the plurality of measurements for cosine and sine components of the quantum phase φ; ii) counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and iii) determining the phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.

In an embodiment, determining the quantum phase φ based on the majority of the number of 0 measurements and the number of 1 measurements of the sine component and the cosine component includes determining a quantization of the quantum phase q(n_(x), n_(y)) as a function of the number of measurements (n_(y)) in the vertical axis for the sine component and the number of measurements (n_(x)) in the horizontal axis for the cosine component.

In an embodiment, the quantization of the quantum phase q(n_(x), n_(y)) is equal to:

0.00 if n_(x) is greater than or equal to a maximum of n_(y) and n−n_(y)+1;

0.01 if n_(y) is greater than or equal to a maximum of n_(x)+1 and n−n_(x);

0.10 if n−n_(x) is greater than or equal to a maximum of n_(y)+1 and n−n_(y); and

0.11 otherwise. The “.” corresponds to the binary period.

It is noted that, according to an aspect of the present invention, the majority sampling method does not calculate the quantum phase itself, i.e., does not calculate the quantum phase by dividing the sine and cosine and then extracting the phase using arctangent. The majority sampling is more efficient as it does not perform this calculation. Instead the quantum phase is determined or estimated in discrete form (in binary form) using the quantization method by counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component and then determining the phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component. The majority sampling method will be explained in further detail in the following paragraphs.

In FIG. 1, the quantum device 10 includes the plurality of quantum circuits 12. Each quantum circuit 12 (including the first quantum circuit 12A and the second quantum circuit 12B) comprises a plurality of circuit elements such as quantum gates, quantum operator, etc.

FIG. 2 is a schematic diagram of the first quantum circuit or the second quantum circuit, according to an embodiment of the present invention. The first quantum circuit 12A or the second quantum circuit 12B comprises a first Hadamard (H) gate 22. The first Hadamard gate 22 is connected to phase shift gate (Z_(θ)) 23. The phase shift gate 23 is connected to a second Hadamard (H) gate 24. The second Hadamard gate 24 is connected to NOT gate or X gate 25 connected to measurement component 26. Although the NOT gate or X gate 25 is shown used in the quantum circuits 12A, 12B, the NOT gate 25 is optional and is simply used to change the quantum bit from |1> to |0> and vice versa. In an embodiment, a second NOT gate (not shown), similar to NOT gate 25, can also be used to prepare the quantum state for the next quantum circuit (e.g., the second quantum circuit 12B), when measuring a |1>. The second NOT gate is connected to measurement component 26. In an embodiment, the second NOT gate is applied after the measurement 26 (after measuring a |1>) to change the qubit |1> to qubit |0> before inputting the qubit |0> into the next quantum circuit (e.g., the second quantum circuit 12B).

A first qubit 27 (for example, |0> as shown in FIG. 2) is input to the first quantum circuit 12A or the second quantum circuit 12B through a first input line 27A via the first Hadamard gate 22. A quantum state |ξ>28 is also input to the first quantum circuit 12A or the second quantum circuit 12B through a second line 28A. In an embodiment, the second line 28A is connected to unitary operator (U^(s)) 29. In an embodiment, the unitary operator (U^(s)) 29 is connected at point 30 to a line between the phase shift gate (Z_(θ)) 23 and the second Hadamard gate 24. In another embodiment, the unitary operator (U^(s)) 29 can instead be connected to a line between the first Hadamard gate 22 and the phase shift gate (Z_(θ)) 23.

In operation, a procedure is applied to determine or estimate the quantum phase φ. In the procedure, the first Hadamard gate 22 is applied to the first state of the first qubit 27 to put the first qubit 27 into a superposition of states. The phase shift gate 23 is then applied to the superposition of states of the first qubit 27 to apply a first phase θ to the first qubit 27. In an embodiment, the first phase θ is applied on the |1> component of the superposition of states. The unitary operator (U^(s)) gate 29 is applied to the quantum state |ξ>28 conditioned on the first qubit 27 to apply a second phase φ to the quantum state |ξ>28. A second Hadamard gate 24 is applied to the first qubit 27. The output of the second Hadamard gate 24 can be optionally reversed using NOT gate 25. A measurement is then performed on the first qubit 27 using measurement component 26 to determine probability values of measuring an output value of one (1) based on input values of the first phase θ. The probability value depends on the first phase θ and the second phase φ. Finally, the second phase φ is determined based on the probability values. As it must be understood, the second phase φ corresponds to the quantum phase induced by the unitary operator in the quantum device 10. The term “second” for the quantum phase φ is used here to differentiate from the “first” phase θ applied by the phase shift gate (Z_(θ)) 23. However, this does not imply the order in which the first phase θ and the second phase φ are applied as the second phase φ can be applied before the first phase θ or vice versa.

In an embodiment, determining the second phase φ includes selecting a value of the first phase θ equal to zero radian and −¼ radian and estimating a sine and a cosine of the second phase φ based on probability values of obtaining an initial second phase at the selected value of the first phase θ. In an embodiment, applying the unitary operator (U^(s)) gate 29 to the quantum state 28 includes applying the second phase φ multiplied by a factor that is proportional to 2 to the power “j−1.” As it will be explained in further detail below, the second phase φ is expressed as a string of binary bits after the binary point. “j” corresponds to incremental bit positions of binary bit values in the string of binary bits of the second phase φ. For example, the quantum phase (i.e., the second phase) φ can be expressed as a string of binary numbers after the binary period as follows: “.β₁β₂β₃ . . . β_(n)”.

In an embodiment, the procedure further includes iteratively adding one bit to the string of binary bits “.β′_(m)β′_(m+1)β′_(m+2)” of an initial second phase per step and shifting a previous bit string by one, and repeating applying the first Hadamard gate 22 to the first state of the first qubit; applying the phase shift gate 23 to the superposition of states of the first qubit to apply the first phase to the first qubit; applying the unitary operator (U^(s)) gate to the quantum state conditioned on the first qubit to apply the second phase to the quantum state; applying the second Hadamard gate 24 on the first qubit; performing the measurement using measured component 26 on the first qubit to determine the probability values of measuring the output value of one based on the input values of the first phase, the probability value depending on the first phase and the second phase; and determining an updated value of the second phase. The above “repeating” means that initially the measurement is performed using the first circuit 12A, then the measurement is repeated by using the second quantum circuit 12B, a third circuit, etc. . . . , until the second phase φ is estimated with the desired precision. In an embodiment, before repeating the measurement using a next quantum circuit (e.g., second quantum circuit 12B), a second NOT gate 25 can be applied to the output of a previous quantum circuit (e.g., first quantum circuit 12A), if the output of the previous quantum circuit (e.g., first quantum circuit 12A) is |1>, to initialize the input of the next quantum circuit (e.g., second quantum circuit 12B) to |0>.

In an embodiment, the procedure further includes choosing the first phase equal to the updated second phase divided by minus two (i.e., choosing θ=−φ_(j+1)/2) to obtain an adjusted second phase that is a threshold value away from a horizontal axis; determining a sign of a cosine of the adjusted second phase; and setting a value of a last added binary bit in the string of binary bits of the updated second phase based on the determined sign of the cosine of the adjusted second phase.

In an embodiment, if the sign of the cosine of the adjusted second phase is positive, setting the last added binary bit of the string of binary bits of the updated second phase to 0 and if the sign of the cosine of the adjusted second phase is negative, setting the last added binary bit of the string of binary bits of the updated second phase to 1.

In an embodiment, determining the updated value of the second phase includes determining with a probability equal to at least substantially one a position of the updated second phase based on the sign of the cosine relative to right or left of a vertical axis when the adjusted second phase is at most π/4 from either 0 or π, or relative to a horizontal axis when the adjusted second phase is at most π/4 from either π/2 or 3π/2, or both. The term “a probability equal to at least substantially one” means that the probability is equal to (1−∈), where ∈ is a relatively small positive number less than 10⁻¹, i.e., E is between 0 and 10⁻¹.

In the following paragraphs, various features of the quantum device and the above method for estimating the quantum phase φ will be described in greater detail with the support of mathematical equations, statements and their verifications. One of ordinary skill in the art when reading the following paragraphs would appreciate the extent to which the inventor has developed in great detail the method of determining the quantum phase. It will become clear in the following paragraphs that the method described herein finds support throughout the detailed description of each of the above features.

As illustrated in the quantum circuit 12A, 12B shown in FIG. 2, initially, assuming an initial state of |0

|ξ

, the circuit first applies a first Hadamard operation using the first Hadamard gate 22 on the first qubit, followed by a phase-shift operation using the phase shift operator Z_(θ) gate 23.

$Z_{\theta} = {\begin{bmatrix} 1 & 0 \\ 0 & e^{i\; 2{\pi\theta}} \end{bmatrix}.}$

The circuit then applies the unitary operator gate U^(s) 29 on the |ξ

28 quantum state, conditioned on the first qubit 27, where

U ^(s)|ξ

=λ^(s) |ξ

=e ^(i2π(sφ))|ξ

.   (1)

Finally, a second Hadamard operation using the second Hadamard gate 24 is applied on the first qubit followed by the application of NOT gate 25 (if needed) and the measurement with measurement component 26. It is noted that the NOT gate is inserted only to simplify exposition, as it allows the inventor to focus on measurements with value 1 instead of 0, which will be more natural. In practice, the measurements could be negated. In addition, as explained in the above paragraphs, another NOT gate can also be used after the measurement of output of a previous quantum circuit (e.g., first quantum circuit 12A) to ensure that a subsequent circuit (e.g., second quantum circuit 12B) has an input qubit set to |0>. All algorithms provided herein apply equivalently to non-negated measurements. The circuit performs the following mapping:

${{\left. {{\left. {{{{{0}\rangle} \otimes}\xi}\rangle}\rightarrow{\left( {\frac{1 - e^{i\; 2{\pi {({{s\; \phi} + \theta})}}}}{2}0}\rangle \right. + \frac{1 + e^{i\; 2{\pi {({{s\; \phi} + \theta})}}}}{2}} \right.1}\rangle} \right) \otimes}\xi}\rangle$

Measuring the first qubit therefore returns 1 with probability

${{P_{\theta}\left( {1\phi} \right)} = {{\frac{1 + e^{i\; 2{\pi {({\phi + \theta})}}}}{2}}^{2} = \frac{1 + {\cos \left( {2{\pi \left( {\phi + \theta} \right)}} \right)}}{2}}},$

and 0 otherwise. By appropriately choosing θ we can obtain information on the sine and cosine of φ, since

cos(2πφ)=2P ₀(1|φ)−1, and sin(2πφ)=2P _(−1/4)(1|φ)−1).   (2)

Repeated measurements of the quantum circuit with θ=0 and θ=−¼ allow us to approximate P₀ and P⁻1/4, from which the sine and cosine values and subsequently {tilde over (φ)} can then be determined. Throughout this specification we use the convention that angles φ, θ, and ω are expressed in radians divided by 2π, whereas angles a are always expressed in radians. We frequently use

${{p_{x}(\alpha)} = \frac{1 + {\cos (\alpha)}}{2}},{{{and}\mspace{14mu} {p_{y}(\alpha)}} = \frac{1 + {\sin (\alpha)}}{2}},$

and write p_(x) and p_(y) when the dependency on a is clear (with α=2πφ).

Kitaev's algorithm: The goal in Kitaev's algorithm is to obtain the approximation

${{\overset{\sim}{\phi}\operatorname{=.}}\overset{\_}{\beta_{1}^{\prime}\beta_{2}^{\prime}\mspace{14mu} \cdots \mspace{14mu} \beta_{m}^{\prime}\beta_{m + 1}^{\prime}\beta_{m + 2}^{\prime}}} = {\sum\limits_{j = 1}^{m + 2}\; {2^{- j}\beta_{j}^{\prime}}}$

for φ=.β₁β₂β₃ . . . , such that |φ−{tilde over (φ)}|≤2^(−(m+2)) holds with probability at least 1−∈. The key principle behind the algorithm lies in the fact that using U^(s) in (1) with s=2^(j−1) gives measurements about sφ, and therefore amounts to shifting the bits in φ to the left by j−1 positions:

φ_(j):=2^(j−1)φ≡.β_(J)β_(J+1)β_(J+2) . . . mod 1.

The multiplicative factor of a causes the phase to be invariant to the integer part β₁ . . . β_(J−1) which can therefore be omitted. As a result, by choosing j we can work with the bitstring starting from any β_(j). Using this, the first step of Kitaev's algorithm is to choose j=m and estimate {tilde over (φ)}_(j)=.β′_(m)β′_(m+1)β′_(m+2) such that |φ_(j)−{tilde over (φ)}_(j)|≤⅛ with probability at least 1−∈ _(m). This is done by taking sufficiently many samples (as will be discussed in detail in the following paragraphs) to estimate cos(2πφ_(j)) and sin(2πφ_(j)) such that the approximated angle ω_(j) deviates from φ_(j) by at most 1/16 with probability at least 1−∈ _(m). The angle ω_(j) is then quantized (rounded) to the nearest integer multiple of ⅛ modulo 1 to obtain {tilde over (φ)}_(j). With a maximum quantization error of 1/16, this amounts to an accuracy of at least ⅛.

FIG. 3A is a plot showing that the estimation of the angle φ_(j) indicated by the dot is done by obtaining estimates of the sine and cosine values (indicated by the purple cross), from which an approximate angle ω_(j) and quantization (010) can be obtained, according to an embodiment of the present invention.

FIG. 3B is a plot showing that the estimation of the angle φ_(j) when the last two bits are fixed to the leading two from previous estimates gives points closest to 001, indicated by the shaded region, or closest to 101 and measuring the cross determines β′_(j)=0, according to an embodiment of the present disclosure. The angle φ_(j+1) is equal to 2φ_(j) modulo 1, and can therefore originate from either of the dots in the plot shown in FIG. 3B.

According to an embodiment of the present invention, a second stage of the algorithm iteratively adds one new bit β′_(j) per step, for j=m−1, . . . , 1. For each step we first obtain a 1/16 accurate approximation ω_(j) of φ_(j) with probability at least 1−∈ _(j) using the technique outlined above. Next, we enforce consistency using the bitstring known so far and set

$B_{j}^{\prime}\mspace{14mu} \text{:=}\mspace{14mu} \left\{ \begin{matrix} {{{0\mspace{14mu} {if}\mspace{14mu} {{{.\overset{\_}{0\beta_{J + 1}^{\prime}\beta_{J + 2}^{\prime}}} - \omega_{j}}}} < {1\text{/}4}},} \\ {{1\mspace{14mu} {if}\mspace{14mu} {{{.\overset{\_}{1\beta_{J + 1}^{\prime}\beta_{J + 2}^{\prime}}} - \omega_{j}}}} < {1\text{/}4.}} \end{matrix} \right.$

Using a union bound on the error probabilities, it can be seen that the algorithm succeeds with probability at least 1−Σ_(j−1) ^(m)∈_(j) Choosing ∈_(j)=∈/m we can therefore ensure with probability at least 1−∈ that all approximate angles ω_(j) are valid, in which case φ will be 2^(−(m+2)) accurate. A graphical illustration of an implementation of Kitaev's algorithm according to an embodiment of the present invention is given in FIGS. 3A and 3B.

The estimation of the sine or cosine terms in equation (2) with accuracy δ needs an estimation of the probability terms to accuracy δ/2. Let s₁, . . . , s_(n), be i.i.d. samples of a Bernoulli distribution with probability of success p=1−P_(θ)(1). Denoting p{tilde over ( )}_(n)=(1/n) Σ_(i=1) ^(n)s_(i), then it follows from the Chernoff bound that

Pr[|ρ−{tilde over (ρ)}_(n)|≥δ/2]≤2e ^(−δ) ² ^(n/2).

We require that the probability 2e^(−δ) ² ^(n/2) be bounded by ∈, which is guaranteed for

${n \geq {n\left( {\delta,\epsilon} \right)}} = {\frac{2}{\delta^{2}}\log \mspace{14mu} {\left( {2\text{/}\overset{\_}{\epsilon}} \right).}}$

For the theoretical complexity of Kitaev's algorithm, we note that m angle estimations ω_(j) are used, each requiring approximate sine and cosine values, therefore yielding a total of 2m estimations. By choosing ∈=∈/2m, we obtain an overall sample complexity of

${\frac{4m}{\delta^{2}}{\log \left( {4m\text{/}\epsilon} \right)}} = {{\vartheta \left( {m\mspace{14mu} {\log \left( {m\text{/}\epsilon} \right)}} \right)}.}$

Implementations using phase shifts: FIGS. 4A and 4B are plots showing an application of a phase shift that ensures that the unknown angle (indicated by the dot) lies within one of the highlighted wedges centered on the horizontal axis, according to an embodiment of the present invention. The more accurate the reference angle, the smaller the wedge, as shown in FIG. 4A with maximum deviation ⅛, and as shown in FIG. 4B with a maximum deviation 1/16.

As a practical implementation to steps in the second stage of Kitaev's algorithm, we consider the situation shown in FIG. 3B. The exact value of φ_(j) is equal to either (0+φ_(j+1))/2, or (1+φ_(j+1))/2, as indicated by the dots. Using the first two bits of the binary representation for {tilde over (φ)}_(j+1), in this case 01, we therefore know that φ_(j) is at most ⅛ away from either 001 or 101. Using this information, we can first rotate φ_(j) by the reference angle, in this case 001, to obtain a new angle that is ⅛ away from either 000 or 100, as illustrated in FIG. 4A.

Now, instead of approximating both sine and cosine we only need to determine the sign of the cosine, which requires far fewer measurements. We then set β′_(j) based on the sign: if it is positive we set β′_(j)=0, otherwise we set β′_(j)=1. We can further improve this scheme by maintaining all known bits and rotate by 0010, instead of by the truncated version 001. Doing so we obtain an angle that is now at most 1/16 away from 0 or ½, as shown in FIG. 4B. By using the full binary string {tilde over (φ)}_(j+1)/2 at each stage, we get increasingly small deviations from 0 or ½, which increases the magnitude of the cosine value and reduces the number of measurements needed to accurately determine the correct sign.

Increasingly accurate rotations: Here we analyze the measurement complexity in detail. Given that the bits β′_(j) are determined in reverse order (that is, from least to most significant), we switch to working with iterations, such that iteration k ∈ [1, m] determines β′_(m+1−k). We now consider iterations k≥2, which comprise the second stage of the algorithm. At each iteration in the second stage we need to determine the sign of the cosine of the shifted angle.

In terms of measurements, this amounts to sampling a majority of either zeros or ones. For the number of measurements we have the following result. For example, if we let α ∈ (0, π/2). Then we can correctly distinguish angles from the sets [−α, α] and [π−α, π+α] with probability at least 1−ε by checking whether the majority of n measurements is 1 or 0, whenever

$\begin{matrix} {n \geq {\frac{\log \left( {1\text{/}\epsilon} \right)}{\log \left( {1\text{/}{\sin (\alpha)}} \right)}.}} & (5) \end{matrix}$

The above can be verified by assuming that an unknown angle lies in the range [−α, α] and denote by p=(1+cos(α))/2. The probability that at most k out of n measurements are 1, with k<np is bounded by [2]:

Pr(X≤k)≤exp(−nD(k/n∥p)),   (6)

where D(α∥p) denotes the relative entropy

${D\left( {a{}p} \right)} = {{a\mspace{14mu} {\log \left( \frac{a}{p} \right)}} + {\left( {1 - a} \right)\mspace{14mu} {\log \left( \frac{1 - a}{1 - p} \right)}}}$

We want the majority of the measurements to be 1 and an error therefore occurs whenever k≤n/2. Choosing k=n/2, which is allowed since p>½, gives α=½ and an error ∈′ bounded by

$\begin{matrix} {\epsilon^{\prime} \leq {\exp \left( {{- \frac{n}{2}}\mspace{14mu} {\log \left( {1\text{/}\left( {4{p\left( {1 - p} \right)}} \right)} \right)}} \right)}} & (7) \end{matrix}$

To simplify, we note that

$\begin{matrix} {{4{p\left( {1 - p} \right)}} = {{4\left( \frac{1 + {\cos (\alpha)}}{2} \right)\left( \frac{1 - {\cos (\alpha)}}{2} \right)} = {{1 - {\cos^{2}(\alpha)}} = {\sin^{2}(\alpha)}}}} & (8) \end{matrix}$

We want to ensure that the right-hand side of (7) is less than or equal to ∈. Taking logarithms and simplification then gives the desired result. The result for [π−α, π+α] follows similarly.

At iteration k we apply a phase shift based on the angle from the previous iteration, and the statement above with respect to equation (5) therefore applies with a equal to α_(k)=π/2^(k+1) (as an example, at iteration k=2 we have a maximum deviation of 1/16 or π/8). When taking a single measurement, the probability of failure is 1−p_(k) where p_(k)=p_(x)(α_(k)). In the special case where k is such that 1−p_(k)≤∈, it is therefore follows that only a single sample is needed. It holds that

$\begin{matrix} {\begin{matrix} {{1 - p_{k}} = {\left( {1 - {\cos \left( {\pi/2^{k + 1}} \right)}} \right)/2}} \\ {= {\sin^{2}\left( {\pi/2^{k + 2}} \right)}} \\ {{\leq {\pi^{2}/2^{2{({k + 2})}}}},} \end{matrix}\quad} & (9) \end{matrix}$

where we use the identity 1−cos(x)=2 sin²(x/2) in the second line and sin(x)≤x for x≥0 in the last. We want to find the value of k such that iterations k through m each require only a single measurement and have a combined error bounded by ∈. Choosing ∈=∈/k, gives the requirement

${\sum\limits_{j = k}^{m}\left( {1 - p_{j}} \right)} \leq {\epsilon/k}$

Bounding the left-hand side as

$\begin{matrix} {{{\sum\limits_{j = k}^{m}{\left( {1 - p_{j}} \right){\sum\limits_{j = k}^{m}{\pi^{2}/2^{2{({j + 2})}}}}}} \leq {\pi^{2}{\sum\limits_{j = k}^{\infty}\left( {1/4} \right)^{j + 2}}}} = {{\frac{4\pi^{2}}{3}\left( \frac{1}{4} \right)^{k + 2}} = {\frac{\pi^{2}}{12}4^{- k}}}} & (10) \end{matrix}$

we obtain the sufficient condition

$\begin{matrix} {4^{- k} \leq \frac{12 \in}{k\; \pi^{2}}} & (11) \end{matrix}$

Taking base-two logarithm and rearranging gives

2k−log₂(k/12)≥log₂(π²/∈).

It can be verified that log2(k/12)<k/22 for k≥0, and we can therefore choose

$\begin{matrix} {{k \geq {k_{\in}:}} = \left\lceil {\frac{22}{43}{\log_{2}\left( {\pi^{2}/\epsilon} \right)}} \right\rceil} & (12) \end{matrix}$

The value of k_(∈) does not depend on m and satisfies that for k_(∈)≥2 for all ∈ ∈ (0, 1]. The bound on the sum of errors for iterations k≥k_(∈) in (10) can be seen to apply for any m. We denote by N_(∈) the total number of measurements taken in the first k_(∈)−1 iterations, each with an error not exceeding ∈. When m<k_(∈) it is clear that at most N_(∈) samples are needed. When m≥k_(∈) we need to take an additional sample for each of the remaining m−k_(∈)+1 steps. The overall sampling complexity is therefore bounded by N_(∈)+m, where N_(∈) depends only on ∈ and the sampling methods used for the first k_(∈)−1 iterations.

Practical sampling schemes: We consider different sampling schemes and study the number of samples needed to attain a desired accuracy with a given error rate. For the evaluation of the error rate, we consider the measurements as a Binomial random variable by counting the number of successful measurements (which could be either 0 or 1, depending on the context). In order to determine the angle to a certain accuracy using n measurements, the number of successful measurements X typically needs to fall in some set K⊆g [n], where [n] denotes the set {0, 1, . . . , n}. For p=p_(x)(α) this is satisfied with probability

$\begin{matrix} {{\Pr \; \left( {\left. K \middle| n \right.,\alpha} \right)} = {\sum\limits_{k \in K}{\begin{pmatrix} n \\ k \end{pmatrix}{p^{k}\left( {1 - p} \right)}^{n - k}}}} & (13) \end{matrix}$

We also require two-dimensional settings with probabilities p_(x) and p_(y) and K ∈ [n] x [n], given by

$\begin{matrix} {{P{r\left( {\left. K \middle| n \right.,a} \right)}} = {\sum\limits_{{({k_{x},k_{y}})} \in K}^{\;}{\begin{pmatrix} n \\ k_{x} \end{pmatrix}\begin{pmatrix} n \\ k_{y} \end{pmatrix}{p_{x}^{k_{x}}\left( {1 - p_{x}} \right)}^{n - k_{x}}{{p_{y}^{k_{y}}\left( {1 - p_{y}} \right)}^{n - k_{y}}.}}}} & (14) \end{matrix}$

The error rate is then given by 1−Pr(K), and the goal is to find the minimum n for which the error is below some threshold ∈. In addition to providing bounds, we use the GNU multi-precision arithmetic library (which can be found in the web at gmplib.org) to evaluate the probabilities in equation (13) and equation (14) numerically, thus allowing us to find the exact minimum number of samples needed to attain the desired error level for each of the methods. The best sampling schemes are then used to obtain numerical values for N_(∈).

Box-based sine and cosine: The first sampling method we look at is the box-based scheme illustrated in FIG. 5A and FIG. 5B. FIG. 5A is a plot showing an estimation of angle ϕ with accuracy η, according to an embodiment of the present invention. The situation in FIG. 5A is guaranteed when the sine and cosine terms are each estimated with precision δ_(ϕ), where the subscript denotes the dependence on ϕ. FIG. 5B is a plot showing the same estimation as in FIG. 5A based on discrete points during sampling, according to an embodiment of the present invention. In this case however using 14 samples each for sine and cosine (remaining three orthants omitted). The idea is to independently estimate cos (2πφ) and sin (2πφ) to an accuracy η, such that the recovered angle differs no more than η (in radians) from the actual angle, with probability at least 1−∈.

The following statement gives the maximum deviation δ(η) allowed in the sine and cosine estimates to reach the desired accuracy in the angle (a verification of this statement is given in the following paragraphs). For any 0≤η≤π/2 we can compute an estimate {tilde over (ϕ)} of any ϕ ∈ [0,2π] with accuracy |{tilde over (ϕ)}−ϕ|≤η from sine and cosine estimates {tilde over (c)} and {tilde over (s)} with |{tilde over (c)}−cos(ϕ)|≤δ and |{tilde over (s)}−sin(ϕ)|≤δ, whenever

$\begin{matrix} {{\delta \leq {\delta (\eta)}} = \frac{\sin (\eta)}{\sqrt{2}}} & (15) \end{matrix}$

For uniform estimation over φ this bound is tight.

Estimating the cosine is equivalent to estimating the probability p=(1+cos(2πφ))/2 with accuracy δ(η)/2. When taking n measurements we can estimate the probability as k/n, where k is the number of measurements that are 1. The success set K_(n,δ)(p) is therefore defined as

K _(n,δ)(p):={k ∈ [n]|(p−δ/2)n≤k≤(p+δ/2)n},   (16)

from which we can then evaluate Pr(K_(n,δ)(p)). One difficulty here is that the probability p depends on the unknown angle 2πφ and we therefore need to consider the error rate for all possible angles.

FIGS. 6A and 6B are plots showing the error probability 1−Pr(K_(n,δ)(p)) as a function of angle for δ=0.3, when taking eight measurements, according to embodiments of the present invention. FIG. 6A is a plot of the error probability for estimating cosine for different angles for n=8 using a bounding box with δ=0.3. FIG. 6B is a plot showing the error probability for sampling different angles using the wedge-based approach with n=5 and η=π/4.

Due to the discrete nature of the samples there are numerous discontinuities, which are best explained using FIG. 5B, we consider the box centered around a point on the circle at a given angle. For the cosine we only need to consider the horizontal component and it may therefore help to think of a projection of the box onto the horizontal axis. Given an angle and corresponding probability p, the set K_(n,p) then consists of all the points on the horizontal axis within the projected box. As the angle increases, the box shifts, thereby gradually adding and removing points from the set K at critical angles. When looking at the limit as the angle approaches a critical angle, we can take p to be the probability associated with the critical angle. It then follows from equation (13) that the probability of success increases when a point is added to the set, and decreases when a point is removed, and vice versa for the error rate. Indeed, these discontinuities are clearly seen in the error rate plotted in FIG. 6A.

The following statement, which can be verified in the following paragraphs shows that for sufficiently large n, the error curve is piecewise convex in p: If we choose δ>0 and let f_(n)(p)=1−Pr(X ∈ K_(n,δ)(p)). Then for n≥max {1+1/δ², 3}, f_(n)(p) is piecewise convex on [0, 1] with breakpoints at [0,1] ∩ {(k/n)±δ/2}_(k∈[n]).

In order to find the maximum error it therefore suffices to evaluate the error function at the critical angles with boundary points removed from K_(n,δ). We note that the lower bound on n is a sufficient condition, and FIG. 6A indicates that the condition on n may be improved or eliminated.

Multi-stage evaluation: Instead of attempting to determine the angle in a single pass, we can also apply the general idea behind Kitaev's algorithm and use a multi-level approach. For a two-level approach, we start with a ¼-accurate estimate for 2φ using ⅛ accurate angle estimation followed by two-bit quantization .β′₁β′₂ . Based on this, we know that .0β′₁β′₂ or .1β′₁β′₂ is a ⅛ accurate approximation for φ and therefore only need to determine the leading bit, which is conveniently done using the phase-shift technique described in the above paragraphs. Even though we quantize the estimation of 2φ to two bits, we can decide how accurately we want to represent the unquantized estimation, obtained based on the sine and cosine estimates, for use in the phase shift. Using k≥2 bits gives a maximum deviation of ⅛+½^(k+1), which, after halving, gives an angle π/8+π/2^(k+1) for the determination of the sign of the cosine. As shown in Table 1, the smaller the angle the fewer measurements are needed to attain a desired confidence level.

TABLE 1 ϵ Angle 10⁻¹ 10⁻² 10⁻³ 10⁻⁴ 10⁻⁵ 10⁻⁶ 10⁻⁷ 10⁻⁸ 10⁻⁹ 10⁻¹⁰ 7π/16 43 139 247 357 469 583 697 813 927 1043 6π/16 11 35 61 87 115 143 171 199 227 257 5π/16 5 15 27 37 49 61 73 85 97 111 4π/16 3 9 15 21 27 33 39 45 53 59 3π/16 1 5 9 13 15 19 23 27 31 35 2π/16 1 3 5 7 9 13 15 17 19 21  π/16 1 1 3 5 5 7 9 9 11 13  π/32 1 1 3 3 5 5 7 7 9 9  π/64 1 1 1 3 3 5 5 5 7 7  π/128 1 1 1 3 3 3 3 5 5 5  π/256 1 1 1 1 3 3 3 3 5 5 Table 1 provides the number of measurement needed to correctly determine the sign of cos(α) with probability at least 1−∈, when α deviates from 0 or π by at most the given angle.

For a three-stage approach we estimate the unquantized angle 4φ with accuracy ¼, and then quantize to a single bit. We then apply two stages of sign determination using a phase shift based on the unquantized angle or a k-bit discretization to obtain the final ⅛ accurate three-bit quantized estimate for φ.

Numerical evaluation: We numerically evaluate the different box-based schemes and summarize the number of measurements for different error rates ∈ in Table 2.

TABLE 2 ϵ Description 10⁻¹ 10⁻² 10⁻³ 10⁻⁴ 10⁻⁵ 10⁻⁶ 10⁻⁷ 10⁻⁸ 10⁻⁹ 10⁻¹⁰ Single-stage box 112 222 334 452 570 688 806 932 1050 1176 Two-stage box (2-bits) 45 83 121 159 201 241 283 325 365 407 Two-stage box (3-bits) 43 79 115 149 189 225 265 305 343 383 Two-stage box (exact) 43 77 111 145 183 217 255 293 331 369 Three-stage box (2-bits) 52 96 142 190 240 286 336 386 434 484 Three-stage box (3-bits) 38 64 96 126 160 190 224 256 288 320 Three-stage box (exact) 32 54 78 104 130 154 180 208 234 260 Single-stage box, jointly 82 186 296 414 534 652 778 896 1014 1140 Single-stage wedge 40 84 132 188 244 300 358 416 476 534 Two-stage wedge (2-bit) 19 37 57 77 99 119 141 163 185 207 Two-stage wedge (3-bit) 17 33 49 67 87 105 125 145 163 183 Two-stage wedge (exact) 15 29 47 63 81 97 115 133 149 169 Three-stage wedge (2-bit) 30 66 102 138 176 216 254 292 330 368 Three-stage wedge (3-bit) 18 38 58 78 98 122 142 164 184 206 Three-stage wedge (exact) 14 28 42 56 70 88 102 116 132 146 Sign based 15 33 51 69 87 105 123 141 165 183 Sign based (bound) 28 48 68 88 108 128 148 168 188 208 Majority and sign 17 29 41 55 67 79 93 105 119 133 Majority and sign (bound) 22 35 48 62 75 88 102 115 128 141 Table 2 provides a number of measurements required using different methods to obtain a ⅛-accurate quantized estimate of φ with probability at least 1−∈.

For the single-stage measurement scheme we choose ∈=∈/2 to estimate the sine and cosine values. For the two-stage scheme we use ∈/4 for the sine and cosine estimation and ∈/2 for the second stage, while for the three-stage scheme we use ∈/6 for sine and cosine, and ∈/3 for the last two stages. For each of the instances, the condition on n (for sufficiently large n, the error curve is piecewise convex in p) is satisfied and the numbers reported are therefore optimal for the given setting. Some reduction in the number of measurements in the box-based measurement schemes may however still be obtained by partitioning ∈ differently over the different stages. The best results are obtained with a three-stage approach, due to the reduction in the number of samples required for the box-based part, as well the limited number of samples needed to accurately determine the sign of the cosine (see Table 1). As a final remark, note that adding more measurements can temporarily increase the error rate due to the discrete nature underlying the error curve. As an example, it can be shown that approximation of the cosine with δ=0.1 succeeds with probability at least 0.7 for all n≥110 except n ∈ {113, . . . , 119}. Even though these transition regions are not always present, they do show that care needs to be taken when changing the number of samples.

Joint determination of sine and cosine error: For the box sampling scheme, we determine the number of samples required based on the maximum error probability of the cosine component over all angles. The same number of measurements is then used to independently estimate the sine component. The sine error curve is the same as the cosine error curve, but shifted by π/2. Based on FIG. 6A, we see that the error probabilities tend to complement, and that joint determination of the error should therefore help reduce the number of measurements. As shown in Table 2 (Single stage box, jointly), this is indeed the case, but the reduction is somewhat modest, and in fact, the reduced number of measurements can be no smaller than that based on the cosine error probability evaluated with ∈=∈ rather than ∈/2.

Wedge-based angle: Given n measurements for both p_(x)=(1+cos(α))/2, and p_(y)=(1+sin(α))/2, we can denote by n_(x) and n_(y) the number of 1 measurements. The box-based approach requires that |py−ny/n|≤δ/2 with high probability, and likewise for p_(x) and n_(x)/n. This requirement enables the use of the Chernoff bound to derive a bound on the number of samples, but is otherwise too restrictive. In FIG. 5B, we see that accurate determination of the angle only needs that (n_(x), n_(y)) lie within a wedge with angles α−η and α+η centered at (n/2, n/2). The probability of success then consists of the set of points K_(n,η)(α) within the wedge, which strictly includes the points accepted for the box-based approach. The number of samples needed to guarantee a 1−∈ probability of success will therefore be at least as good or smaller than the box-based approach.

Numerical evaluation: Similar to the numerical evaluation of the box approach, in order to find the error rate corresponding to a given number of measurements n, we need to minimize Pr(K_(n,η)(α)) over α. This can be done by sweeping over the angles α, determining K_(n,η)(α) at each point, as illustrated in FIGS. 7A and 7B. FIGS. 7A and 7B are plots showing combinations of sine and cosine measurements that estimate the angle at the center of the wedge with maximum deviation ⅛, according to an embodiment of the present invention. An example of the resulting error probability for n=5 and η=π/4 is shown in FIG. 6B. The break-points in the curve happen at angles where grid points are on the boundary of the wedge (for even n, the origin of the wedge (n/2, n/2) is excluded and is therefore not considered to lie on the boundary).

The approach therefore is to find all angles α at which the wedge boundary intersects grid points, and evaluate the error probability at those angles, with boundary points at either the bottom or top edges omitted to obtain the limit as a approaches the critical angle from a clockwise or counter-clockwise direction. The error probability in FIG. 6B appears piecewise convex, but we did not attempt to rigorously establish this. The number of measurements determined using the above algorithm should therefore be interpreted as a lower bound for the method. The resulting number of measurements for the single-stage wedge-based approach, as well as the extension to the two- and three-stage approach described above, are listed in Table 2.

Triple-sign sampling: FIGS. 8A-8D are plots showing the estimation of (a) the horizontal, (b) the vertical component of the angle, accurate for angles in the shaded regions, (c) combination of the two sign-based estimates to obtain a ¼ accurate quantization, and (d) alternative quantization obtained by applying a π/4 rotation before the measurements and an inverse rotation and relabeling afterwards, according to an embodiment of the present invention. When angle α is at most π/4 from either 0 or π, as illustrated in FIG. 8A, the sign-based approach can be used with p_(x) to determine with probability at least 1−∈ whether the point lies on the right or left of the vertical axis. Similarly, when α is π/4 close to π/2 or 3π/2, as shown in FIG. 8B, we can tell with the same probability whether the point lies above or below the horizontal axis. When a lies outside of the given range we make no assumption on the results in either case. When applying both schemes we can combine the obtained signs, as shown in FIG. 8C. By construction we know that at least one of the two is correct, up to the desired success rate of 1−∈. For angles between π/4 and 3π/4, as illustrated in the plot, this means that when the method succeeds we obtain either 01 or 11. The maximum error obtained in this case is therefore π/2. A more convenient quantization can be obtained by applying a phase shift of π/4 prior to applying the two measurement steps, followed by the inverse phase shift to the result. After changing the labels we obtain the quantization values given in FIG. 8D. To obtain a more accurate (e.g., ⅛ accurate) estimation we can apply an additional step with sign-based sampling.

For the sufficient number of measurements per component, the statement above with respect to equation (5)applied with α=π/4 gives

$\begin{matrix} {{n \geq \frac{\log \left( {1/\epsilon} \right)}{\log \left( {1/{\sin \left( {\pi/4} \right)}} \right)}} = {\frac{\log \left( {1/\epsilon} \right)}{\log \left( {2/\sqrt{2}} \right)} = {\frac{\log \left( {1/\epsilon} \right)}{{\log (2)} - {{\log (2)}/2}} = {2{{\log_{2}\left( {1/\epsilon} \right)}.}}}}} & (17) \end{matrix}$

The first stage uses n measurements each for the horizontal and vertical component. The second stage uses another n measurements, for a total of 3n measurements. For each of the three steps we can choose ∈=∈/2 for a total maximum error of ∈. Note that the maximum error in the first stage is ∈, since one of the two components is irrelevant (although we do not know which of the two it is). Combined we can take

N=3[2 log₂(1/∈)]≤9+6 log₂(1/∈),   (18)

where the inequality is due to the addition of 3 to account for rounding to integers.

The majority sampling method: In an embodiment, for majority sampling, we take n measurements for the sine and cosine components, and count the number of positive measurements by n_(y) and n_(x), respectively. FIGS. 9A-9C are plots of classification regions for majority-based sampling for (a) odd, and (b) even n; and (c) the success set K_(n) for angles in the range [0, π/2), according to an embodiment of the present invention. The quantized approximation of the angle is defined in terms of the majority of the number of 0 or 1 measurements

${q\left( {n_{x},n_{y}} \right)}\left\{ \begin{matrix} {.\overset{\_}{00}} & {n_{x} \geq {\max \left\{ {n_{y},{n - n_{y} + 1}} \right\}}} \\ {.\overset{\_}{01}} & {n_{y} \geq {\max \left\{ {{n_{x} + 1},\ {n - n_{x}}} \right\}}} \\ {.\overset{\_}{10}} & {{n - n_{x}} \geq {\max \left\{ {{n_{y} + 1},{n - n_{y}}} \right\}}} \\ {.\overset{\_}{11}} & {{otherwise},} \end{matrix} \right.$

which gives partitions as illustrated in FIGS. 9A and 9B. We want to obtain an estimator that is ¼ accurate with probability at least 1−∈. In particular, we allow angles ϕ ∈ [0, ¼) to be quantized as either 0.00 or 0.01, and similarly for interval increments of ¼. We denote by K_(ab) the set of points that map to .ab, this gives a success set of K₀₀ ∪ K₀₁. For the analysis of the error we work with a reduced set K_(n)={(i, j)|i, j ∈ [0, n], j≥n−i+1}, illustrated by the top-right triangle in FIG. 9C.

Based on the above, we have the following result (which can be verified in below paragraphs). If we let K_(n)={(i, j)|i, j ∈ [0, n], j≥n−i+1}, then for all α ∈ [0, π/2]

${1 - {P{r\left( {\left. K_{n} \middle| n \right.,\alpha} \right)}}} \leq {\frac{2}{2^{n}}.}$

We expect that this result can be improved by a factor of two. FIG. 10 is a plot of error probability f_(n)(α) scaled by 2^(n), with from top to bottom n=1, 2, 3, 5, 10, 25, 100, 500, according to an embodiment of the present invention. The error probability can be defined by the following equation

f _(n)(α)=1−Pr(K _(n) |n, α)   (19)

over angles α=2πφ. As shown in FIG. 10, the error curves are convex and attain the maximum at α=0. The error probability is the summation of the probabilities for (i, j) ∉ K_(n). At α=0, we have p_(x)=1, which implies that all terms including (1−p_(x))^(n−i) are zero, except those with i=n. The only such point is (n, 0), and we therefore have

f _(n)(0)=(1−p _(y))^(n)=(1−1/2)^(n)=2^(−n).

We can now expand K_(n) with any of the points in the gray part of the diagonal in FIG. 9C. This lowers the error for α>0 but does not affect f_(n)(0). Under the assumption that the maximum of f_(n)(α) is attained at α=0, the maximum error for the set K₀₀ ∪ K₀₁ is therefore 2^(−n). By rotational symmetry the same applies for the remaining quadrants, including the special case of K₁₁ for even n. Extending K_(n) only decreases the error and the result in the above statement with respect to the error probability continues to hold. The error probability for the majority-based approach over all angles is therefore bounded by 2/2^(n), which can likely be improved to ½^(n). The approach requires n samples in both the horizontal and vertical direction therefore amounting to a total of N=2n samples. In order to achieve an accuracy of ⅛, we combine the majority-based approach with a single stage of sign determination. The resulting number of samples for different values of ∈ is listed in Table 2. A theoretical bound on the number of samples can be found using (equation 17), giving

N=2 [log₂(4/∈)]+[2 log₂(2/∈)]≤9+4 log₂(1/∈).

This bound can be lowered by two samples if it can be shown that α=0 maximizes f_(n)(α) over [0, π/2].

Evaluation of N_(∈): For a given ∈ we can first determine k_(∈) using (12) and set ∈=∈/k_(∈). We denote by N_(k) the number of samples in steps k=1, . . . , k_(∈)−1. For the first step we can either use the triple-sign (s) or majority (m) based approaches giving respectively

N ₁ ^(s)=9+6 log₂(1/∈), or N ₁ ^(m)=9+4 log₂(1/∈).   (20)

For the remaining steps we use the sign-based approach with angles α=π/2^(k−1). Using the statement above with respect to equation (5), and ignoring rounding up to the nearest integer we can take

${N_{k} = {{\frac{\log \left( {1/\overset{\rightarrow}{\epsilon}} \right)}{\log \left( {1/{\sin \left( {\pi/2^{k + 1}} \right)}} \right)} \leq \frac{\log \left( {1/\overset{\rightarrow}{\epsilon}} \right)}{\log \left( 2^{k - 1} \right)}} = \frac{\log_{2}\left( {1/\overset{\rightarrow}{\epsilon}} \right)}{k - 1}}},$

where the inequality follows from sin(n/2^(k+1))≤π/2^(k+1)≤4/2^(k+1)=1/2^(k−1). Summing over N_(k) gives

$\begin{matrix} {{\sum\limits_{k = 2}^{k_{\epsilon} - 1}N_{k}} = {{{{\log_{2}\left( {1/\overset{\_}{\epsilon}} \right)}{\sum\limits_{k = 1}^{k_{\epsilon} - 2}\left( \frac{1}{k} \right)}} \leq {{\log_{2}\left( {1/\overset{\_}{\epsilon}} \right)}\left( {1 + {\int_{1}^{k_{\epsilon} - 2}{x^{- 1}{dx}}}} \right)}} = {{\log_{2}\left( {1/\overset{\_}{\epsilon}} \right)}\left( {1 + {\log \left( {k_{\epsilon} - 2} \right)}} \right)}}} & (21) \end{matrix}$

To account for rounding up of the intermediate values we add one for each of the remaining k_(∈)−2 steps. Combining equations (20), (21), and the rounding term, and using log₂(1/∈)=log₂(1/∈)+log₂(k_(∈))) gives

N _(∈) ^(s)≤7+k _(∈)+(7+log(k _(∈)−2))·(log₂(1/∈)+log₂(k _(∈)))   (22)

for triple-sign based sampling and

N _(∈) ^(m)≤7+k _(∈)+(5+log(k _(∈)−2))·(log₂(1/∈)+log₂(k _(∈)))   (23)

for majority-based sampling.

Numerical evaluation: For a numerical evaluation of N_(∈) we first determine the critical iteration k_(∈) by finding the smallest integer k that satisfies equation (11). Based on k_(∈) we set ∈=∈/k_(∈) and use both the triple-sign and majority-based sampling methods for the first iteration. After that we use sign-based sampling with increasingly accurate phase shifts to obtain the total number of evaluations before reaching iteration k_(∈). The resulting values for N_(∈) are plotted in FIGS. 11A and 11B along with the theoretical bounds given in equations (22) and (23). FIGS. 11A and 11B are plots of the numerical evaluation of N_(∈) along with the theoretical upper bound, using (a) triple-sign sampling, and (b) majority-based sampling, respectively, according to an embodiment of the present invention.

A summary of k_(∈) for different values of ∈ as well as N_(∈) values for the two different sampling methods used in the first iteration is given in Table 3.

TABLE 3 ϵ Description 10⁻¹ 10⁻² 10⁻³ 10⁻⁴ 10⁻⁵ 10⁻⁶ 10⁻⁷ 10⁻⁸ 10⁻⁹ 10⁻¹⁰ k_(ϵ) using (11) 3 5 7 9 10 12 14 16 17 19 k_(ϵ) using (12) 4 6 7 9 11 12 14 16 17 19 N_(ϵ) ^(s) (triple-sign) 24 56 84 116 147 177 213 243 280 314 N_(ϵ) ^(s) (triple-sign, bound (22)) 44 84 123 163 197 237 277 317 353 394 N_(ϵ) ^(m) (majority) 24 48 72 96 121 147 175 199 226 256 N_(ϵ) ^(m) (majority, bound (23)) 34 66 98 130 158 190 223 256 285 319 Table 3 is a summary of k_(∈) for different values of ∈ as well as N_(∈) values for different sampling methods.

Finally, Table 4 provides the total number of iterations needed to obtain a 2^(−(m+2)) accurate phase estimate with probability at least 1−∈ up to and including iteration k_(∈). For each combination of ∈ and m that contains a number, we choose ∈=∈/m. The dashed fields are in the regime where a single measurement can be taken per additional bit of the estimated angle, without having to change ∈.

TABLE 4 Number of samples required to obtain a 2^(−(m+2)) accurate estimation of φ with probability at least 1 − ϵ using triple-sign based sampling (top) and majority-based sampling (bottom). Dashed lines indicate the regime where a single extra measurement is needed for each successive m. m ϵ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Triple-sign sampling 10⁻¹ 15 16 19 — — — — — — — — — — — — — — — — 10⁻² 33 36 41 42 45 — — — — — — — — — — — — — — 10⁻³ 51 58 61 66 69 70 73 — — — — — — — — — — — — 10⁻⁴ 69 78 83 86 89 94 97 98 99 — — — — — — — — — — 10⁻⁵ 87 98 105 110 113 116 119 122 127 130 — — — — — — — — — 10⁻⁶ 105 118 125 132 137 140 145 150 153 156 159 160 — — — — — — — 10⁻⁷ 123 138 147 154 161 166 169 172 175 178 183 186 189 190 — — — — — 10⁻⁸ 141 158 169 178 185 190 195 198 203 206 209 212 215 218 219 220 — — — 10⁻⁹ 165 184 199 208 215 220 225 230 233 236 239 242 245 248 251 254 257 — — 10⁻¹⁰ 183 206 219 228 235 242 247 252 259 264 267 272 275 278 281 284 287 290 291 Majority-based sampling 10⁻¹ 17 20 25 — — — — — — — — — — — — — — — — 10⁻² 29 34 43 44 49 — — — — — — — — — — — — — — 10⁻³ 41 50 57 62 69 70 73 — — — — — — — — — — — — 10⁻⁴ 55 68 73 80 83 88 93 96 97 — — — — — — — — — — 10⁻⁵ 67 82 91 98 101 106 109 114 119 122 — — — — — — — — — 10⁻⁶ 79 96 107 114 121 124 131 136 141 144 147 148 — — — — — — — 10⁻⁷ 93 112 123 132 139 146 151 154 157 160 167 170 173 176 — — — — — 10⁻⁸ 105 126 141 150 159 166 171 174 181 184 189 192 195 198 199 200 — — — 10⁻⁹ 119 142 159 170 179 184 189 196 201 204 207 210 213 216 219 224 227 — — 10⁻¹⁰ 133 160 173 186 193 200 209 214 221 226 229 234 239 244 247 250 253 256 257

Discussion: In the above paragraphs, we have analyzed several sampling schemes for use in quantum phase estimation, including quantum phase estimation based on Kitaev algorithm, and show that using previous phase estimates to shift the phase can reduce the number of measurements. Based on this we show that we can obtain a theoretical sampling complexity N_(∈)+m to obtain a 2^(−(m+2)) accurate estimation of the phase φ with probability at least ∈. The present methods according to embodiments of the present invention (including the majority sampling method) can also take advantage of increasingly accurate rotations of the quantum phase to further narrow the estimate of the quantum phase. Even with practical limitations on the phase shift accuracy, the present sampling schemes can still reduce the number of measurements, as shown, for example, in Table 1. From a theoretical point of view, having a limited accuracy re-introduces a log(m) dependency in the algorithmic complexity, and it may therefore be interesting to analyze the application of the sampling schemes to the phase estimation to enable faster quantum phase estimation.

The maximum of f_(n)(α) in (19) over [0, π/2] is attained at α=0. This confirms a sampling complexity of 2 log2(1/∈) for the majority-based approach. This can be verified for n=1 and n=2, and FIG. 9 indicates this holds for all n. Indeed, for n=1 we have

f _(n)(α)=(1−sin(α)−cos(α)−sin(α)cos(α))/4,

which is convex over the given range due to concavity of the trigonometric terms, and the result therefore follows from the symmetry f_(n)(α)=f_(n)(π/2−α). Empirically, the error functions for box-, wedge-, and majority-based sampling all exhibit convexity or piecewise convexity. This may indicate a more general relationship between the error over certain index sets K and α.

The maximum deviation δ(η) allowed in the sine and cosine estimates to reach the desired accuracy in the angle is provided by the following: For any 0≤η≤π/2 we can compute an estimate ϕ of any ϕ ∈ [0, 2π] with accuracy |{tilde over (ϕ)} ϕ|≤η from sine and cosine estimates {tilde over (c)} and {tilde over (s)} with |{tilde over (c)}−cos(ϕ)|≤δ and |{tilde over (s)}−sin(ϕ)|≤δ, whenever

$\begin{matrix} {{\delta \leq {\delta (\varphi)}} = \frac{\sin \; (\eta)}{\sqrt{2}}} & (24) \end{matrix}$

For uniform estimation over φ this bound is tight.

The above can be verified as follows. For η=0 the result holds trivially with δ=0, and we therefore only need to consider η>0. We can recover any ϕ with accuracy η from approximate sine and cosine values {tilde over (c)} and {tilde over (s)} if and only if ({tilde over (c)}, {tilde over (s)}) lies within a wedge of angles between ϕ−η and ϕ+η (illustrated by the shaded region in FIGS. 5A and 5B). For δ, this means that the square with sides 2δ centered on ϕ must to lie within the wedge. For 0<η≤π/4 we can assume without loss of generality that ϕ ∈ [0, π/4]. It can be seen that the intersection of the top-left corner of the box, at (cos(ϕ)−δ, sin(ϕ)+δ), with the boundary of the wedge at angle ϕ+η determines the maximum value of δ. Formalizing, we write δ(ϕ) to indicate the dependence on ϕ and denote the wedge boundary as x=α(ϕ)y, with

${\alpha (\varphi)} = \frac{\cos \left( {\varphi + \eta} \right)}{\sin \left( {\varphi + \eta} \right)}$

For δ to be valid we need cos(ϕ)−δ≥α(ϕ)(sin(ϕ)+δ), which can be rewritten as

$\begin{matrix} {{\delta \leq {\delta (\varphi)}} = \frac{{\cos (\varphi)} - {{\alpha (\varphi)}{\sin (\varphi)}}}{1 + {\alpha (\varphi)}}} & (25) \end{matrix}$

We then need to minimize δ(ϕ) over the given range of ϕ to find the largest value of δ that applies for all ϕ. Abbreviating α=α(ϕ) and gradient α′=α′(ϕ), we have

$\begin{matrix} {\mspace{76mu} {{= {{{- {\sin (\varphi)}}\left( {\frac{1}{1 + \alpha} - \frac{\alpha^{\prime}}{\left( {1 + \alpha} \right)^{2}}} \right)} - {{\cos (\varphi)}\left( {\frac{\alpha}{1 + \alpha} - \frac{\alpha^{\prime}}{\left( {1 + \alpha} \right)^{2}}} \right)}}}\mspace{76mu} {From}{{\alpha^{\prime} = {- \frac{1}{\sin^{2}\left( {\varphi - \eta} \right)}}},{{{and}\mspace{14mu} \alpha^{2}} = {\frac{\cos^{2}\left( {\varphi + \eta} \right)}{\sin^{2}\left( {\varphi + \eta} \right)} = {\frac{1 - {\sin^{2}\left( {\varphi + \eta} \right)}}{\sin^{2}\left( {\varphi + \eta} \right)} = {\frac{1}{\sin^{2}\left( {\varphi + \eta} \right)} - 1}}}},}}} & (26) \end{matrix}$

It follows that α′+α²=1, or α′=−1−α², which allows us to simplify the sine coeffient as

$\begin{matrix} {{{\frac{1}{1 + \alpha} + \frac{\alpha^{\prime}}{\left( {1 + \alpha} \right)^{2}}} = {{\frac{1 + \alpha}{\left( {1 + \alpha} \right)^{2}} - \frac{1 + \alpha^{2}}{\left( {1 + \alpha} \right)^{2}}} = \frac{\alpha \left( {1 - \alpha} \right)}{\left( {1 + \alpha} \right)^{2}}}},} & (27) \end{matrix}$

Whereas for the cosine coefficient we find

$\begin{matrix} {{\frac{\alpha}{1 + \alpha} + \frac{\alpha^{\prime}}{\left( {1 + \alpha} \right)^{2}}} = {\frac{\alpha + \alpha^{2} + \alpha^{\prime}}{\left( {1 + \alpha} \right)^{2}} = {\frac{\left( {\alpha - 1} \right)}{\left( {1 + \alpha} \right)^{2}}.}}} & (28) \end{matrix}$

Substituting (27) and (28) in (26) gives

$\begin{matrix} {{\delta^{\prime}(\varphi)} = {{{\cos (\varphi)}\frac{\left( {1 - \alpha} \right)}{\left( {1 + \alpha} \right)^{2}}} - {\alpha \mspace{14mu} {\sin (\varphi)}{\frac{\left( {1 - \alpha} \right)}{\left( {1 + \alpha} \right)^{2}}.}}}} & (29) \end{matrix}$

Noting that η>0 and considering the range of ϕ, we have 0<sin(ϕ+η)≤1. This allows us to multiply the first term in (29) by sin(ϕ+η)/sin(ϕ+η), and expand the enumerator in this term using the sum formula as

sin(ϕ+η)=sin(ϕ)cos(η)+cos(ϕ)sin(η)

Finally, expanding the numerator cos(ϕ+η) in the a term preceding sin(ϕ) as

cos(ϕ+η)=cos(ϕ)cos(η)−sin(ϕ)sin(η)

and simplifying gives

$\begin{matrix} {{\delta^{\prime}(\varphi)} = {\frac{\left( {1 - \alpha} \right)}{\left( {1 + \alpha} \right)^{2}\mspace{14mu} {\sin \left( {\varphi + \eta} \right)}}{{\sin (\eta)}.}}} & (30) \end{matrix}$

All terms in this expression, except α−1, are strictly positive. The gradient is therefore zero only when α=1, which happens at ϕ*=π/4−η. For ϕ<ϕ* we have α(ϕ)>1 and therefore δ′(ϕ)<0, whereas for ϕ>ϕ* we have α(ϕ)<1 and δ′(ϕ)>0, which shows that ϕ* gives a minimizer. Evaluating δ(ϕ*) in (25) and noting that α(ϕ*)=1 then gives

δ≤δ(ϕ)=(cos(π/4−η)−sin(π/4−η))/2

To obtain the desired result, we simplify δ(ϕ) using the sum formulas and cos(π/4)=sin(π/4)=√{square root over (2)}/2:

$\begin{matrix} {{\delta (\varphi)} =} & {{\frac{1}{2}\left( {\left( {{{\cos \left( \frac{\pi}{4} \right)}\mspace{14mu} {\cos (\eta)}} + {{\sin \left( \frac{\pi}{4} \right)}\mspace{14mu} {\sin (\eta)}}} \right) -} \right.}} \\  & \left. \left( {{{\sin \left( \frac{\pi}{4} \right)}\mspace{14mu} {\cos (\eta)}} - {{\cos \left( \frac{\pi}{4} \right)}\mspace{14mu} {\sin (\eta)}}} \right) \right) \\ {=} & {{{\frac{\sqrt{2}}{4}\left( {\left( {{\cos (\eta)} + {\sin (\eta)}} \right) - \left( {{\cos (\eta)} - {\sin (\eta)}} \right)} \right)} = {\frac{1}{\sqrt{2}}{{\sin (\eta)}.}}}} \end{matrix}$

For π/4≤η≤π/2 we can assume without loss of generality that ϕ ∈ [−π/4, 0]. In this case the top-left corner of the box can again be seen to limit δ. The argument as given above follows through as is, thus completing the above verification.

For sufficiently large n, the error curve is piecewise convex in p, provided as follows: If we choose δ>0 and let f_(n)(p)=1−Pr(X ∈ K_(n),δ(p)) with K_(n,p) as defined in (16). Then for n≥max{1+1/δ², 3}, f_(n)(p) is piecewise convex on [0, 1] with breakpoints at [0,1] ∩ {(k/n)±δ/2}k_(∈)[n].

The above statement can be verified as follows. From the definition of K_(n,δ)(p), it is clear that K_(n,δ)(p) remains constant precisely on the (open) segment between the stated breakpoints. Choose any segment, then for all values of p within this segment, the error is obtained by summing B(k; n, p) over k ∉K_(n,δ)(p), with

${B\left( {{k;n},p} \right)} = {\begin{pmatrix} n \\ k \end{pmatrix}{{p^{k}\left( {1 - p} \right)}^{n - k}.}}$

In order to prove convexity of the error over the segment, we show that the each of the terms B(k; n, p) is convex in p over the segment. For conciseness we normalize with respect to the binomial coefficient and work with

${{B\left( {{k;n},p} \right)}\mspace{14mu} \text{:=}\mspace{14mu} {B\left( {{k;n},p} \right)}} = {\begin{pmatrix} n \\ k \end{pmatrix}.}$

or n=2, observe that the second derivative B″_(1,2)(p)=−2 is negative, which means that B_(1,2)(p) is concave. We, therefore, require that n≥3. For k=0 and k=n we find

B″ _(0,n)(p)=n(n−1)(1−p)n ⁻², and B″ _(n,n)(p)=n(n−1)p ^(n−2).

The second derivatives are non-negative over the domain p ∈ [0, 1] and the functions are therefore convex. For 0<k<n we have

$\begin{matrix} \begin{matrix} {{B_{k,n}^{\prime}(p)} = {\left( {{k\left( {1 - p} \right)} - {\left( {n - k} \right)(p)}} \right)\left( {p^{k - 1}\left( {1 - p} \right)}^{n - k - 1} \right)}} \\ {= {\left( {k - {np}} \right)\left( {p^{k - 1}\left( {1 - p} \right)}^{n - k - 1} \right)}} \end{matrix} & (31) \end{matrix}$

and the gradient reaches zero when p=0, p=1, or p=k/n. For k=1 we find

$\begin{matrix} {{B_{1,n}^{''}(p)} = {\left\lbrack {{- {n\left( {1 - p} \right)}} - {\left( {1 - {np}} \right)\left( {n - 2} \right)}} \right\rbrack \left( {1 - p} \right)^{n - 3}}} \\ {= {\left\lbrack {{{np}\left( {n - 1} \right)} - {2\left( {n - 1} \right)}} \right\rbrack \left( {1 - p} \right)^{n - 3}}} \end{matrix}$

For convexity we want B″_(1,n)(p)≥0, and therefore require that the square-bracketed term be nonnegative. Solving for p then gives convexity of B″_(1,n)(p) for p≥2/n. By symmetry, it follows that for k=n−1, B″_(n−1,n)(p) is convex for p≤1−2/n. Finally, for 2≤k≤n−2 it follows from (31) that

$\begin{matrix} {{B_{k,n}^{''}(p)} =} & {\left( {{- {{np}\left( {1 - p} \right)}} + {\left( {k - {np}} \right)\left( {{\left( {k - 1} \right)\left( {1 - p} \right)} -} \right.}} \right.} \\  & {\left. \left. {\left( {n - k - 1} \right)p} \right) \right) \cdot \left( {p^{k - 2}\left( {1 - p} \right)}^{n - k - 2} \right)} \\ {=} & {{\left\lbrack {{{n\left( {n - 1} \right)}p^{2}} - {2{k\left( {n - 1} \right)}} + {k\left( {k - 1} \right)}} \right\rbrack \cdot {\left( {p^{k - 2}\left( {1 - p} \right)}^{n - k - 2} \right).}}} \end{matrix}$

The term in square brackets is a quadratic in p, and solving for the roots gives

${p \pm} = {\frac{k}{n} \pm {\frac{\sqrt{{k\left( {n - 1} \right)}\left( {n - k} \right)}}{n\left( {n - 1} \right)}.}}$

The deviation is maximum at k=n/2, which gives

${\frac{\sqrt{{k\left( {n - 1} \right)}\left( {n - k} \right)}}{n\left( {n - 1} \right)} \leq \frac{\left( \frac{n}{2} \right)\sqrt{n - 1}}{n\left( {n - 1} \right)}} = {\frac{1}{2\sqrt{n - 1}}.}$

The second derivative B″_(k,n) is therefore guaranteed to be nonnegative, and B_(k,n) convex, when p is at least 1/(2√{square root over (n−1)}) away from the maximum at k/n. It can be verified that the same sufficient condition applies for k=0 and k=n.

-   For any p in the selected segment we know that K_(n,δ)(p) remains     constant and that |k/n−p|≥δ/2 for any k ∉K_(n,δ)(p). To guarantee     convexity we therefore require that

δ/2≥1/(2√{square root over (n−1)})

which simplifies to n≥1+1/δ².

The following statement regarding the error probability can also be verified. If we let K_(n)={(i, j)|i, j ∈ [0,n], j≥n−i+1}, then for all α∈ [0, π/2]

${1 - {\Pr \left( {{K_{n}n},a} \right)}} \leq \frac{2}{2^{n}}$

For example, if we denote by ε_(n)={(i,j)|i,j ∈ [0, n], i+j≤n} the complement of K_(n). The error probability Pr(ε_(n)|n, α)=1Pr(Kn|n, α) is then obtained by summing f_(i,j) over (i, j) ∈ ε_(n), where

${f_{i,j}(\alpha)} = {\begin{pmatrix} n \\ i \end{pmatrix}\begin{pmatrix} n \\ j \end{pmatrix}{p_{x}^{i}\left( {1 - p_{x}} \right)}^{n - i}{p_{y}^{j}\left( {1 - p_{y}} \right)}^{n - j}}$

Defining the diagonal sums k ∈ [0, n] as

${{d_{k}(\alpha)} = {\sum\limits_{i = 0}^{k}\; {f_{i,{k - j}}(\alpha)}}},$

we can equivalently write Pr(ε_(n)|n, α)=Σ_(k=0) ^(n)d_(k)(α). For α ∈ [0, π/2] it is easily seen that dk(α)=dk(π/2−α), and it therefore suffices to show the desired result for α ∈ [0, π/4]. As a first step, we bound the value of the main diagonal d_(n) by 2^(−n):

$\begin{matrix} \begin{matrix} {{d_{n}(\alpha)} = {\sum\limits_{j = 0}^{n}\; {\begin{pmatrix} n \\ {n - j} \end{pmatrix}\begin{pmatrix} n \\ j \end{pmatrix}{p_{x}^{n - j}\left( {1 - p_{x}} \right)}^{j}{p_{y}^{j}\left( {1 - p_{y}} \right)}^{n - j}}}} \\ {{= {\left( {p_{x}\left( {1 - p_{y}} \right)} \right)^{n}{\sum\limits_{j = 0}^{n}\; {\begin{pmatrix} n \\ j \end{pmatrix}^{2}\left( \frac{p_{y}\left( {1 - p_{x}} \right)}{p_{x}\left( {1 - p_{y}} \right)} \right)^{j}}}}}} \\ {{= {\left( {p_{x}\left( {1 - p_{y}} \right)} \right)^{n}{\sum\limits_{j = 0}^{n}\; \left( {\begin{pmatrix} n \\ j \end{pmatrix}\left( \frac{p_{y}\left( {1 - p_{x}} \right)}{p_{x}\left( {1 - p_{y}} \right)} \right)^{j\text{/}2}} \right)^{2}}}}} \\ {{\leq {\left( {p_{x}\left( {1 - p_{y}} \right)} \right)^{n}\left( {\sum\limits_{j = 0}^{n}\; {\begin{pmatrix} n \\ j \end{pmatrix}\left( \frac{\sqrt{p_{y}\left( {1 - p_{x}} \right)}}{\sqrt{p_{x}\left( {1 - p_{y}} \right)}} \right)^{j}}} \right)^{2}}}} \\ {{\overset{(i)}{=}{\left( {p_{x}\left( {1 - p_{y}} \right)} \right)^{n}\left( {1 + \frac{\sqrt{p_{y}\left( {1 - p_{x}} \right)}}{\sqrt{p_{x}\left( {1 - p_{y}} \right)}}} \right)^{2n}}}} \\ {{\overset{({ii})}{=}{\left( {p_{x}\left( {1 - p_{y}} \right)} \right)^{n}\left( \frac{1}{2{p_{x}\left( {1 - p_{y}} \right)}} \right)^{n}}}} \\ {{{= 2^{- n}},}} \end{matrix} & (32) \end{matrix}$

where (i) uses the binomial theorem and (ii) follows from the observation that

$\begin{matrix} {\left( {1 + \frac{\sqrt{p_{y}\left( {1 - p_{x}} \right)}}{\sqrt{p_{x}\left( {1 - p_{y}} \right)}}} \right)^{2} = \left( \frac{\sqrt{p_{x}\left( {1 - p_{y}} \right)} + \sqrt{p_{y}\left( {1 - p_{x}} \right)}}{\sqrt{p_{x}\left( {1 - p_{y}} \right)}} \right)^{2}} \\ {{= \frac{{p_{x}\left( {1 - p_{y}} \right)} + {2\sqrt{{p_{x}\left( {1 - p_{x}} \right)}{p_{y}\left( {1 - p_{y}} \right)}}} + {p_{y}\left( {1 - p_{x}} \right)}}{p_{x}\left( {1 - p_{y}} \right)}}} \\ {{\overset{(8)}{=}\frac{{p_{x}\left( {1 - p_{y}} \right)} + {2\sqrt{{\sin^{2}(\alpha)}{\cos^{2}(\alpha)}\text{/}16}} + {p_{y}\left( {1 - p_{x}} \right)}}{p_{x}\left( {1 - p_{y}} \right)}}} \\ {{= \frac{\begin{matrix} \left( {1 + {{\cos (\alpha)}\left( {1 - {\sin (\alpha)}} \right)\text{/}4} +} \right. \\ {{\sin (\alpha){\cos (\alpha)}\text{/}2} + {\left( {1 + {\sin (\alpha)}} \right)\left( {1 - {\cos (\alpha)}} \right)\text{/}4}} \end{matrix}}{p_{x}\left( {1 - p_{y}} \right)}}} \\ {{= {\frac{1}{2{p_{x}\left( {1 - p_{y}} \right)}}.}}} \end{matrix}$

For the second step we derive a bound on d_(n−1) based on d_(n), from which we then obtain a bound on d_(n−1)+d_(n). For i≥1 we have

$f_{{i - 1},j} = {f_{i,j} \cdot \frac{1 - p_{x}}{p_{x}} \cdot {\frac{i}{n - i + 1}.}}$

The right-most term, which accounts for the change in the binomial coefficient

$\begin{pmatrix} n \\ i \end{pmatrix},$

is less than or equal to 1 for i≤n/2 when n is even, and for i≤(n+1)/2 when n is odd. A similar argument applies for the transition from f_(i,j) to f_(i,j)−1 for 1≤j≤(n+1)/2, allowing us to bound the elements on the (n−1)-diagonal d_(n)−1 as follows:

$f_{i,j} \leq \left\{ \begin{matrix} {{{\frac{1 - p_{x}}{p_{x}}f_{{i + 1},j}i} < {\left( {n - 1} \right)\text{/}2}},} \\ {\frac{1 - p_{y}}{p_{y}}f_{{i + i},j}\mspace{11mu} {{otherwise}.}} \end{matrix} \right.$

FIGS. 12A-12D show constructions for bounding (a,b) d_(n)−1 based on d_(n), and (c,d) the sum of d_(k) for strided k, according to an embodiment of the present invention. As illustrated in FIGS. 12A and 12B, this approach uses the middle element of the main diagonal twice. Taking this into account, and effectively doing the same for all elements, we have

$\begin{matrix} {{d_{n - 1} \leq {\left( {\frac{1 - p_{x}}{p_{x}} + \frac{1 - p_{y}}{p_{y}}} \right)d_{n}}} = {\frac{{p_{y}\left( {1 - p_{x}} \right)} + {p_{x}\left( {1 - p_{y}} \right)}}{p_{x}p_{y}}{d_{n}.}}} & (33) \end{matrix}$

Combining (32) and (33) we have

$\begin{matrix} {{d_{n} + d_{n - 1}} \leq {\frac{p_{x} + p_{y} - {p_{x}p_{y}}}{p_{x}p_{y}} \cdot {2^{- n}.}}} & (34) \end{matrix}$

As the third step, we derived bound on d_(k)−2 based on d_(k). Consider any diagonal 2≤k≤n, with 0<i<k and j=k−i, then

${\begin{pmatrix} n \\ {i - 1} \end{pmatrix}\begin{pmatrix} n \\ {j - 1} \end{pmatrix}} = {{\begin{pmatrix} n \\ {i - 1} \end{pmatrix}\begin{pmatrix} n \\ {k - i - 1} \end{pmatrix}} = {{{\frac{i}{n - i + 1} \cdot \frac{k - i}{n - k + i + 1}}\begin{pmatrix} n \\ i \end{pmatrix}\begin{pmatrix} n \\ {k - i} \end{pmatrix}} = {{\kappa \begin{pmatrix} n \\ i \end{pmatrix}}\begin{pmatrix} n \\ j \end{pmatrix}}}}$

Since k≤n, the multiplicative term κ satisfies

$\kappa = {\frac{i\left( {k - i} \right)}{{i\left( {k - i} \right)} + {n\left( {n - k + 1} \right)} - k + 2} \leq \frac{i\left( {k - i} \right)}{{i\left( {k - i} \right)} + n - k + 2} \leq \frac{i\left( {k - i} \right)}{{i\left( {k - i} \right)} + 2} < 1.}$

It therefore follows that

$f_{{i - 1},{k - i - 1}} \leq {f_{i,{k - 1}} \cdot \frac{\left( {1 - p_{x}} \right)}{p_{x}} \cdot {\frac{\left( {1 - p_{y}} \right)}{p_{y}}.}}$

The transition from diagonal k to k−2 follows by summing over all elements i+j=k−2, giving

${{d_{k - 2} \leq {\frac{\left( {1 - p_{x}} \right)\left( {1 - p_{y}} \right)}{p_{x}p_{y}}d_{k}}} = {\tau \; d_{k}}},$

with τ<1, as shown in FIG. 13A. FIGS. 13A-13B are plots of key quantities used in verifying the statement with respect to the error probability, according to an embodiment of the present invention. As a fourth step we sum over the even and odd diagonals. Starting at k=n or k=n−1 we have

${{\sum\limits_{i = 0}^{k\text{/}2}\; d_{k - {2i}}} \leq {\sum\limits_{i = 0}^{\infty}\; {\tau^{i}d_{k}}}} = {{\frac{1}{1 - \tau}d_{k}} = {\frac{p_{x}p_{y}}{p_{x} + p_{y} - 1} \cdot d_{k}}}$

For the sum of the diagonals, and hence that f_(i,j) over the error set set ε_(n), it follows from equation (34) that

${{\sum\limits_{k = 0}^{n}\; d_{k}} \leq {\frac{p_{x}p_{y}}{p_{x} + p_{y} - 1}\left( {d_{n} + d_{n - 1}} \right)} \leq {\frac{p_{x}p_{y}}{p_{x} + p_{y} - 1} \cdot \frac{p_{x} + p_{y} - {p_{x}p_{y}}}{p_{x}p_{y}} \cdot 2^{- n}}} = {\frac{p_{x} + p_{y} - {p_{x}p_{y}}}{p_{x} + p_{y} - 1} \cdot {2^{- n}.}}$

The desired result then follows from the observation that (p_(x)+p_(y)−p_(x)p_(y))/(p_(x)+p_(y)−1)≤2, as illustrated in FIG. 13B.

The descriptions of the various embodiments of the present invention have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. 

I claim:
 1. A method for determining a quantum phase induced by a unitary operator in a quantum device, the method comprising: providing a plurality of quantum circuits connected in series, wherein an output of a first quantum circuit in the plurality of quantum circuits is an input of a second quantum circuit in the plurality of quantum circuits; and determining a quantum phase induced by the unitary operator by performing a plurality of measurements of an output of each of the plurality of quantum circuits comprising performing a first measurement in the plurality of measurements of the quantum phase using the first quantum circuit in the plurality of quantum circuits and performing a second measurement in the plurality of measurements of the quantum phase using the second quantum circuit in the plurality of quantum circuits; wherein a number of the plurality of quantum circuits used to determine the quantum phase depends on a number of the plurality of measurements needed to determine the quantum phase within a desired precision, wherein the number of the plurality of measurements is reduced for the desired precision by using a majority sampling method comprising: performing a plurality of measurements for cosine and sine components of the quantum phase; counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and determining the quantum phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.
 2. The method according to claim 1, wherein the desired precision is at least 2 binary bits after the binary point.
 3. The method according to claim 1, wherein determining the phase based on the majority of the number of 0 measurements and the number of 1 measurements of the sine component and the cosine component comprises determining a quantization of the quantum phase q(n_(x), n_(y)) as a function of the number of measurements (n_(y)) in the vertical axis for the sine component and the number of measurements (n_(x)) in the horizontal axis for the cosine component.
 4. The method according to claim 3, wherein the quantization of the quantum phase q(n_(x), n_(y)) is equal to: 0.00 if n_(x) is greater than or equal to a maximum of n_(y) and n−n_(y)+1; 0.01 if n_(y) is greater than or equal to a maximum of n_(x)+1 and n−n_(x); 0.10 if n−n_(x) is greater than or equal to a maximum of n_(y)+1 and n−n_(y); and 0.11 otherwise.
 5. The method according to claim 1, wherein performing the first measurement or the second measurement comprises: applying a first Hadamard gate to a first state of a first qubit to put the first qubit into a superposition of states; applying a phase shift gate to the superposition of states of the first qubit to apply a first phase to the first qubit; applying a unitary operator (U^(s)) gate to a quantum state conditioned on the first qubit to apply a second phase to the quantum state; applying a second Hadamard gate to the first qubit; performing a measurement on the first qubit to determine probability values of measuring an output value of one based on input values of the first phase, the probability value depending on the first phase and the second phase; and determining the second phase based on the probability values.
 6. The method according to claim 1, further comprising applying a NOT gate on the first qubit after applying the second Hadamard gate.
 7. The method according to claim 1, wherein determining the second phase comprises selecting a value of the first phase equal to zero radian and −¼ radian and estimating a sine and a cosine of the second phase based on probability values of obtaining an initial second phase at the selected value of the first phase.
 8. The method according to claim 7, wherein applying the unitary operator (U^(s)) gate to the quantum state comprises applying the second phase multiplied by a factor that is proportional to 2 to the power j−1, wherein the second phase is expressed as a string of binary bits after the binary point and wherein j corresponds to incremental bit positions of binary bit values in the string of binary bits of the second phase.
 9. The method according to claim 8, further comprising: iteratively adding one bit to the string of binary bits of an initial second phase per step and shifting a previous bit string by one, and repeating applying the first Hadamard gate to the first state of the first qubit; applying the phase shift gate to the superposition of states of the first qubit to apply the first phase to the first qubit; applying the unitary operator (U^(s)) gate to the quantum state conditioned on the first qubit to apply the second phase to the quantum state; applying the second Hadamard gate on the first qubit; performing the measurement on the first qubit to determine the probability values of measuring the output value of one based on the input values of the first phase, the probability value depending on the first phase and the second phase; and determining an updated value of the second phase.
 10. The method according to claim 9, further comprising: choosing the first phase equal to the updated second phase divided by minus two to obtain an adjusted second phase that is a threshold value away from a horizontal axis; determining a sign of a cosine of the adjusted second phase; and setting a value of a last added binary bit in the string of binary bits of the updated second phase based on the determined sign of the cosine of the adjusted second phase.
 11. The method according to claim 10, wherein if the sign of the cosine of the adjusted second phase is positive, setting the last added binary bit of the string of binary bits of the updated second phase to 0 and if the sign of the cosine of the adjusted second phase is negative, setting the last added binary bit of the string of binary bits of the updated second phase to
 1. 12. The method according to claim 11, wherein determining the updated value of the second phase comprises determining with a probability equal to at least substantially one a position of the updated second phase based on the sign of the cosine relative to right or left of a vertical axis when the adjusted second phase is at most π/4 from either 0 or π, or relative to a horizontal axis when the adjusted second phase is at most π/4 from either π/2 or 3π/2, or both.
 13. A method of determining a quantum phase of quantum device, comprising: performing a plurality of measurements for cosine and sine components of the quantum phase; counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and determining the quantum phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.
 14. The method according to claim 13, wherein determining the phase based on the majority of the number of 0 measurements and the number of 1 measurements of sine component and the cosine component comprises determining a quantization of the quantum phase q(n_(x), n_(y)) as a function of the number of measurements (n_(x)) in the vertical axis for the sine component and the number of measurements (n_(y)) in the horizontal axis for the cosine component.
 15. The method according to claim 14, wherein the quantization of the quantum phase q(n_(x), n_(y)) is equal to: 0.00 if n_(x) is greater than or equal to a maximum of n_(y) and n−n_(y)+1; 0.01 if n_(y) is greater than or equal to a maximum of n_(x)+1 and n−n_(x); 0.10 if n−n_(x) is greater than or equal to a maximum of n_(y)+1 and n−n_(y); and 0.11 otherwise.
 16. The method according to claim 13, further comprising: iteratively adding one bit to the string of binary bits of an initial second phase per step and shifting a previous bit string by one, and repeating applying the first Hadamard gate to the first state of the first qubit; applying the phase shift gate to the superposition of states of the first qubit to apply the first phase to the first qubit; applying the unitary operator (U^(s)) gate to the quantum state conditioned on the first qubit to apply the second phase to the quantum state; applying the second Hadamard gate on the first qubit; performing the measurement on the first qubit to determine the probability values of measuring the output value of one based on the input values of the first phase, the probability value depending on the first phase and the second phase; and determining an updated value of the second phase.
 17. The method according to claim 16, further comprising: choosing the first phase equal to the updated second phase divided by minus two to obtain an adjusted second phase that is a threshold value away from a horizontal axis; determining a sign of a cosine of the adjusted second phase; and setting a value of a last added binary bit in the string of binary bits of the updated second phase based on the determined sign of the cosine of the adjusted second phase.
 18. The method according to claim 17, wherein if the sign of the cosine of the adjusted second phase is positive, setting the last added binary bit of the string of binary bits of the updated second phase to 0 and if the sign of the cosine of the adjusted second phase is negative, setting the last added binary bit of the string of binary bits of the updated second phase to
 1. 19. The method according to claim 18, wherein determining the updated value of the second phase comprises determining with a probability equal to at least substantially one a position of the updated second phase based on the sign of the cosine relative to right or left of a vertical axis when the adjusted second phase is at most π/4 from either 0 or π, or relative to a horizontal axis when the adjusted second phase is at most π/4 from either π/2 or 3π/2, or both.
 20. A quantum device comprising a plurality of quantum circuits for determining the quantum phase, comprising: a plurality of quantum circuits connected in series, wherein an output of a first quantum circuit in the plurality of quantum circuits is an input of a second quantum circuit in the plurality of quantum circuits, wherein the plurality of quantum circuits are configured and arranged to determine a quantum phase induced by a unitary operator in the quantum device by performing a plurality of measurements of an output of each of the plurality of quantum circuits comprising performing a first measurement in the plurality of measurements of the quantum phase using the first quantum circuit in the plurality of quantum circuits and performing a second measurement in the plurality of measurements of the quantum phase using the second quantum circuit in the plurality of quantum circuits; wherein a number of the plurality of quantum circuits used to determine the quantum phase depends on a number of the plurality of measurements needed to determine the quantum phase within a desired precision, wherein a number of the plurality of measurements is reduced for the desired precision by using a majority sampling method comprising: performing a plurality of measurements for cosine and sine components of the quantum phase; counting a number of measurements in a vertical axis for the sine component and counting a number of measurements in a horizontal axis for the cosine component; and determining the quantum phase based on a majority of a number of 0 measurements and a number of 1 measurements of the sine component and the cosine component.
 21. The quantum device according to claim 20, wherein the first quantum circuit or the second quantum circuit or both comprises: a first Hadamard gate configured to apply to a first state of a first qubit to put the first qubit into a superposition of states; a phase shift gate configured to apply to the superposition of states of the first qubit a first phase; a unitary operator (U^(s)) gate configured to apply to a quantum state conditioned on the first qubit a second phase; a second Hadamard gate configured to apply a second quantum phase to the first qubit; a measurement component configured to perform a measurement on the first qubit to determine probability values of measuring an output value of one based on input values of the first phase, the probability value depending on the first phase and the second phase. 